import java.util.Scanner;

public class JavaMethod {
    //



    //在同一个类中定义多个方法：要求不仅可以求2个整数的最大值，还可以求3个小数的最大值？
    public static void fun3(int a,int b) {
        int max = 0;
        if(a>b){
            max=a;
        }else{
            max=b;
        }
        System.out.println(a+"和"+b+"之间最大的值为："+max);
    }
    public static void fun4(double c,double d,double e) {
        double max = 0;
        if(c>d){
            if(c>e){
                max=c;
            }else {
                max=e;
            }

        }else {
            if(d>e){
                max=d;
            }else {
                max=e;
            }
        }
        System.out.println("三者之间最大值为："+max);
    }
    public static void main5(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        fun3(a,b);
        double c = scanner.nextDouble();
        double d = scanner.nextDouble();
        double e = scanner.nextDouble();

        fun4(c,d,e);
    }


    //在同一个类中,分别定义求两个整数的方法 和 三个小数之和的方法。 并执行代码，求出结果
    public static void fun1(int a,int b) {
        int sum = a+b;
        System.out.println(a+"和"+b+"之和为："+sum);
    }
    public static void fun2(double c,double d,double e) {
        double sum = 0;
        sum = c+d+e;
        System.out.println("三者之和为："+sum);
    }
    public static void main4(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        fun1(a,b);
        double c = scanner.nextDouble();
        double d = scanner.nextDouble();
        double e = scanner.nextDouble();

        fun2(c,d,e);
    }

    //MyToString



    //求斐波那契数列的第n项。(迭代实现)
    public static void main3(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();

        System.out.println(fibonacci(n));
    }

    public static int fibonacci(int n) {
        if(n<=2){
            return 1;
        }else{
            return (fibonacci(n-1)+fibonacci(n-2));
        }

    }




    //求1！+2！+3！+4！+........+n!的和
    public static void main2(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int sum=0;
        for (int i = n; i >=1 ; i--) {
            for (int j = i; i >= 1 ; i--) {
                sum=sum+j;
            }
        }
        System.out.println(sum);

    }

    public static void main1(String[] args) {
        //求N的阶乘
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int sum=0;
        for (int i = n; i >= 1; i--) {
            sum=sum+i;
        }
        System.out.println(sum);
    }
}
